package thinkingJava.chapter14;

import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.util.regex.Pattern;

public class ShowMethods {
	private static Pattern pattern = Pattern.compile("\\w+\\.");

	public static void main(String[] args) {
		int lines = 0;
		try {
			Class<?> c = Class.forName("thinkingJava.chapter14.ShowMethods");
			Method[] methods = c.getMethods();
			Constructor[] cons = c.getConstructors();
			for (Method method : methods) {
				System.out.println(pattern.matcher(method.toString()).replaceAll(""));
			}
			for (Constructor con : cons) {
				System.out.println(pattern.matcher(con.toString()).replaceAll(""));
			}
			lines = methods.length + cons.length;
		} catch (ClassNotFoundException e) {
			throw new RuntimeException(e);
		}
	}
}
